package com.ptszyxx.popose.module.main.dynamic.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder;
import com.ptszyxx.popose.R;
import com.ptszyxx.popose.databinding.ItemDynamicCommentReplyBinding;
import com.ysg.http.data.entity.dynamic.CommentReplyEntity;
import com.ptszyxx.popose.module.main.dynamic.vm.DynamicCommentVM;

public class DynamicCommentReplyAdapter extends BaseQuickAdapter<CommentReplyEntity, BaseDataBindingHolder<ItemDynamicCommentReplyBinding>> {

    private DynamicCommentVM viewModel;

    public DynamicCommentReplyAdapter(DynamicCommentVM viewModel) {
        super(R.layout.item_dynamic_comment_reply);
        this.viewModel = viewModel;
    }

    @Override
    protected void convert(BaseDataBindingHolder<ItemDynamicCommentReplyBinding> holder, CommentReplyEntity item) {
        ItemDynamicCommentReplyBinding binding = holder.getDataBinding();
        if (binding != null) {
            binding.setEntity(item);
            binding.setViewModel(viewModel);
            binding.setPosition(holder.getBindingAdapterPosition());
            binding.executePendingBindings();

        }
    }









}
